package com.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class nowTime {
    public String nTime(){
        // 获取当前时间
        LocalDateTime now = LocalDateTime.now();
        // 格式化时间
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String formattedTime = now.format(formatter);
        return formattedTime;
    }
}
